﻿@{
    ViewBag.Title = "新增、编辑岗位";
}
@model KingRoad.Pay.Entity.Base_Duty           
<script src="/Scripts/jQuery/jquery.validate.min.js" type="text/javascript"></script>
<script src="/Scripts/jQuery/jquery.validate.unobtrusive.min.js" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $("#form_Permission_Organize_createDuty").submit(function () {
            return false;
        });
        if ("@ViewBag.Flag" == "Edit") {
            $("#form_Permission_Organize_createDuty").attr("action", "/Permission/Organize/DutyEditing");
            $("#btnSave_permission_organize_createDuty").html("更新");
        } else {
            $("#ParentId").val("@ViewBag.ID");
            $("#OrganizeId").val("@ViewBag.OrganizeID");
            //$("#OrganizeFlag").val("");
        }
        $("#txtParentName").val("@ViewBag.ParentName");
        $("#txtDepartmentName").val("@ViewBag.OrganizeName");
//        $("#clear_permission_organize_createDuty").click(function () {
//            $("#txtParentName").val("");
//            $("#ParentId").val("0");
//        });
        $("#clear_permission_organize_createDuty0").click(function () {
            $("#txtDepartmentName").val("");
            $("#OrganizeId").val("0");
        });
    });   
</script>
<div class="pageContent">
    @{Html.EnableClientValidation();}
    @using (Html.BeginForm("DutyCreating", "Organize", null, FormMethod.Post, new { onsubmit = "return validateCallback(this,dialogAdded_Permission_Organize);", @id = "form_Permission_Organize_createDuty", @class = "pageForm" }))
    {   
    <div class="pageFormContent" layouth="58">
        <table width="95%" class="tab01">
            <tr>
                <td class="td1">
                    <label>
                        父节点：</label>
                </td>
                <td>
                     @Html.Raw(Model == null || Model.ID == null ? "" : "<input type=\"hidden\" value=\"" + Model.ID + "\" id=\"ID\" name=\"Id\" />")
                    
                    @Html.HiddenFor(m => m.ParentId)
                    <input type="text" id="txtParentName" value="" onclick="return false;" />
                    <a class="button" href="/Permission/Organize/SelectOrganize/1_0" target="dialog" rel="dialog_permisson_organize_createDuty" title="请选择..." mask="true" width="280" height="350"><span>选择</span></a>
                </td>
            </tr>
            <tr>
                <td class="td1">
                    <label>
                        名称：</label>
                </td>
                <td>
                    @Html.TextBoxFor(m => m.Name, new Dictionary<string, object> { { "alt", "请输入名称" } })
                    @Html.ValidationMessageFor(m => m.Name)
                </td>
            </tr>
            <tr>
                <td class="td1">
                    <label>
                        编号：</label>
                </td>
                <td>
                    @Html.TextBoxFor(m => m.Code)
                    @Html.ValidationMessageFor(m => m.Code)
                </td>
            </tr>
            <tr>
                <td class="td1">
                    <label>
                        所属部门：</label>
                </td>
                <td>
                    @Html.HiddenFor(m => m.OrganizeId)
                    <input type="text" id="txtDepartmentName" value="" onclick="return false;" />
                    <a class="button" href="/Permission/Organize/SelectOrganize/3_2" target="dialog" rel="dialog_permisson_organize_createDuty0" title="请选择..." mask="true" width="280" height="350"><span>选择</span></a>
                    <a class="button" id="clear_permission_organize_createDuty0" href="javascript:void(0);"><span>置空</span></a>
                </td>
            </tr>           
            <tr>
             <td class="td1">
                    <label>
                        <input type="hidden" name="FromOrganize" id="FromOrganize" value="@ViewBag.OrganizeFlag"  />
                        </label>
                </td>
            <td align="center">
            <input type="checkbox" name="Enabled" id="Enabled" value="1"  @Html.Raw(Model == null || Model.Enabled == null ? "checked='checked'" : (Model.Enabled == 1 ? "checked='checked'" : "")) />有效
            &nbsp;&nbsp;&nbsp;&nbsp;
            <input type="checkbox" name="IsManage" id="IsManage" value='1' @Html.Raw(Model == null || Model.IsManage == null ? "value='0'" : (Model.IsManage==1 ? "checked='checked'" : "")) />管理岗位
            </td>
            </tr>
            <tr>
                <td class="td1">
                    <label>
                        备注：</label>
                </td>
                <td>
                @Html.TextAreaFor(m => m.Remark)
                </td>
            </tr>
        </table>
    </div>
    <div class="formBar">
        <ul>
            <li>
                <div class="buttonActive">
                    <div class="buttonContent">
                        <button type="submit" id="btnSave_permission_organize_createDuty">
                            保存</button></div>
                </div>
            </li>
            <li>
                <div class="button">
                    <div class="buttonContent">
                        <button type="button" class="close">
                            取消</button></div>
                </div>
            </li>
        </ul>
    </div>
    }
    @*</form>*@
</div>
        
